package com.example.meizu002.service.impl;

import com.example.meizu002.entity.Phone;
import com.example.meizu002.entity.UserTrade;
import com.example.meizu002.mapper.UserTradeMapper;
import com.example.meizu002.service.UserTradeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class UserTradeServiceImpl implements UserTradeService {
    @Autowired
    private UserTradeMapper userTradeMapper;

    @Override
    public List<UserTrade> findAll() {
        List<UserTrade> userTrades = userTradeMapper.findAll();
        return userTrades;
    }

    @Override
    public void addPhone(UserTrade userTrade) {
        userTradeMapper.addPhone(userTrade);
    }

    @Override
    public void deletePhone(int id) {
        userTradeMapper.deletePhone(id);
    }

    @Override
    public UserTrade findOne(int id) {
        return userTradeMapper.findOne(id);
    }

    @Override
    public void updatePhone(UserTrade userTrade) {
        userTradeMapper.updatePhone(userTrade);
    }
}
